//
//  loginAndRegister.m
//  lv678
//
//  Created by apple on 15/6/15.
//  Copyright (c) 2015年 lampshade. All rights reserved.
//

#import "loginAndRegister.h"


@interface loginAndRegister ()
{
    UIView * _registerView;
    UIView * _activeView;
    
}
//active





@property (weak, nonatomic) IBOutlet UIScrollView *scroll;

@property (weak, nonatomic) IBOutlet UISegmentedControl *isCommon;

- (IBAction)isRegisterOrActive:(id)sender;



@end

@implementation loginAndRegister

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.navigationController setNavigationBarHidden:NO animated:YES];
    //初始化view
    _activeView   = [[[NSBundle mainBundle]loadNibNamed:@"ActiveView" owner:self options:nil]lastObject];
    _registerView = [[[NSBundle mainBundle]loadNibNamed:@"RegisterView" owner:self options:nil]lastObject];

    [self.view addSubview:_registerView];
    [self.view addSubview:_activeView];
    [self.view bringSubviewToFront:_registerView];
    
    UIColor *color = [UIColor whiteColor];
    NSDictionary *dict = [NSDictionary dictionaryWithObject:color forKey:NSForegroundColorAttributeName];
    [self.navigationController.navigationBar setTitleTextAttributes:dict];
    //    [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"Navigation"] forBarMetrics:UIBarMetricsDefault];
    [self.navigationController.navigationBar setTintColor:[UIColor whiteColor]];
    self.navigationController.navigationBar.tintColor = [UIColor whiteColor];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

//segment视图切换
- (IBAction)isRegisterOrActive:(id)sender {
    
    switch (_isCommon.selectedSegmentIndex) {
        case 0:
            [self.view bringSubviewToFront:_registerView];
            break;
         case 1:
            [self.view bringSubviewToFront:_activeView];
        default:
            break;
    }
    
}

- (BOOL)textFieldShouldReturn:(UITextField *)textField{
    [textField resignFirstResponder];
    return true;
};

@end
